package com.hhf.springboot.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hhf.springboot.common.DataGroupByDateDTO;
import com.hhf.springboot.model.dto.bisheProject.BisheProjectQueryRequest;
import com.hhf.springboot.model.dto.bisheProject.BisheProjectStatisticsDTO;
import com.hhf.springboot.model.entity.BisheProject;
import com.hhf.springboot.model.vo.BisheProjectVO;
import com.hhf.springboot.model.vo.WordCloud;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;

/**
 * 毕设项目服务
 *
 * @author hhf
 * @from <a href="https://gitee.com/hanhuaifei/projects">我的gitee</a>
 * @Date 2024/9/26
 */
public interface BisheProjectService extends IService<BisheProject> {

    /**
     * 校验数据
     *
     * @param bisheProject
     * @param add 对创建的数据进行校验
     */
    void validBisheProject(BisheProject bisheProject, boolean add);

    /**
     * 获取查询条件
     *
     * @param bisheProjectQueryRequest
     * @return
     */
    QueryWrapper<BisheProject> getQueryWrapper(BisheProjectQueryRequest bisheProjectQueryRequest);
    
    /**
     * 获取毕设项目封装
     *
     * @param bisheProject
     * @param request
     * @return
     */
    BisheProjectVO getBisheProjectVO(BisheProject bisheProject, HttpServletRequest request);

    /**
     * 分页获取毕设项目封装
     *
     * @param bisheProjectPage
     * @param request
     * @return
     */
    Page<BisheProjectVO> getBisheProjectVOPage(Page<BisheProject> bisheProjectPage, HttpServletRequest request);

    /**
    * 分按日期分组查询毕设项目新增数量
    *
    * @param beginDate 开始时间
    * @param endDate   结束时间
    * @return
    */
    List<DataGroupByDateDTO> countByDay(Date beginDate, Date endDate);


    /**
     * 分页获取毕设项目(封装tags-> tagList)
     *
     * @param bisheProjectPage
     * @return
     */
    Page<BisheProject> getBisheProjectPage(Page<BisheProject> bisheProjectPage);

    /**
     * 项目浏览
     * @param bisheProjectId
     * @return
     */
    long doClick(Long bisheProjectId);

    /**
     * 获取 bisheProject 的点击量(clickNum)总数量
     * @return
     */
    Long getClickNumTotalCount();

    /**
     * 获取词云数据
     * @return
     */
    List<WordCloud> getBisheProjectTagWordCloud();


    /**
     * 获取毕设统计数据
     * @return
     */
    BisheProjectStatisticsDTO getBisheStatistics();
}
